package com.example.demo.service;

import com.example.demo.dao.UserDao;
import com.example.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class UserServiceImpl  implements  UserService{
    @Autowired
    UserDao  userDao;
    @Override
    public boolean save(User user) {
        return userDao.insert(user)==1?true:false;

    }

    @Override
    public List<User> getUserList(User user) {
        return userDao.selectByParam(user);
    }

    @Override
    public User getUser(Integer id) {
        return userDao.selectByPrimaryKey(id);
    }
}
